<!DOCTYPE html>
<html>
<head>
    <!-- 页面meta -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>疫情数据填报监控</title>
    <meta name="description" content="疫情数据填报监控">
    <meta name="keywords" content="疫情数据填报监控">
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
    <!-- 引入样式 -->
    <link rel="stylesheet" href="../static/plugins/elementui/index.css">
    <link rel="stylesheet" href="../static/plugins/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="../static/css/style.css">
    <script src="../static/plugins/echarts/echarts.js"></script>
</head>
<body class="hold-transition">
<div id="app">
    <div class="content-header">
        <h1>统计分析<small>单省数据报表</small></h1>
        <el-breadcrumb separator-class="el-icon-arrow-right" class="breadcrumb">
            <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
            <el-breadcrumb-item>统计分析</el-breadcrumb-item>
            <el-breadcrumb-item>单省数据报表</el-breadcrumb-item>
        </el-breadcrumb>
    </div>
    <div class="app-container">
        <div class="box">
            <div class="filter-container">
                <el-input placeholder="省份名称" v-model="queryString" style="width: 200px;"
                          class="filter-item"></el-input>
                <el-button @click="clickfind()" class="dalfBut">查询</el-button>
            </div>
            <el-container>
                <el-main>
                    <!-- 为 ECharts 准备一个具备大小（宽高）的 DOM -->
                    <div id="chart1" style="height:600px;"></div>
                </el-main>
                <el-aside width="35%">
                    <div id="chart2" style="height:80%;"></div>
                    <div style="height:20%;"></div>
                </el-aside>
            </el-container>
        </div>
    </div>
</div>
</body>
<!-- 引入组件库 -->
<script src="../static/js/vue.js"></script>
<script src="../static/plugins/elementui/index.js"></script>
<script type="text/javascript" src="../static/js/jquery.min.js"></script>
<script src="../static/js/axios-0.18.0.js"></script>
<script type="text/javascript">
    var vue = new Vue({
            el: '#app',
            data: {
                queryString: null,//查询条件
                dataList: [],//当前页要展示的分页列表数据
                formData: {},//表单数据
                dialogFormVisible: false,//增加表单是否可见
                dialogFormVisible4Edit: false,//编辑表单是否可见
            },
            //钩子函数，VUE对象初始化完成后自动执行
            created() {
                this.clickfind();
            },
            methods: {
                clickfind() {
                    axios.get("/areaCount?province=" + this.queryString).then((res) => {
                        var myChart1 = echarts.init(document.getElementById('chart1'));
                        var ec_right1_option = {
                            //标题样式
                            title: {
                                text: "地区历史确诊人数汇总",
                                textStyle: {
                                    color: 'black',
                                },
                                left: 'center'
                            },
                            grid: {
                                left: '5%',
                                right: '3%',
                                bottom: '3%',
                            },
                            color: ['#3398DB'],
                            tooltip: {
                                trigger: 'axis',
                                axisPointer: {            // 坐标轴指示器，坐标轴触发有效
                                    type: 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
                                }
                            },
                            xAxis: {
                                type: 'category',
                                color: 'white',
                                data: res.data.city,
                                axisLabel: {
                                    interval: 0
                                }
                            },
                            yAxis: {
                                type: 'value',
                                color: 'white',
                            },
                            series: [{
                                data: res.data.confirm,
                                type: 'bar',
                                barMaxWidth: "50%"
                            }]
                        };
                        myChart1.setOption(ec_right1_option)
                    });
                    axios.get("/areaPie?province=" + this.queryString).then((res) => {
                        var myChart2 = echarts.init(document.getElementById('chart2'));
                        var ec_right2_option = {
                            tooltip: {
                                trigger: 'item'
                            },
                            legend: {
                                top: 'bottom',
                            },
                            grid: {
                                left: '1%',
                                right: '1%',
                                bottom: '1%',
                            },
                            series: [
                                {
                                    name: 'Access From',
                                    type: 'pie',
                                    radius: '50%',
                                    data: res.data.data,
                                    emphasis: {
                                        itemStyle: {
                                            shadowBlur: 10,
                                            shadowOffsetX: 0,
                                            shadowColor: 'rgba(0, 0, 0, 0.5)'
                                        }
                                    }
                                }
                            ]
                        };
                        myChart2.setOption(ec_right2_option)
                    });
                }
            }
        })
    ;
</script>
</html>
